import generator
import alg

class Test():
    def __init__(self , n):
        self.listNums = n
        self.listIns = []
        self.minMax = []
        #随机生成 n 组数据  并求得其最小子数组最大和
        for i in range(self.listNums):
            temp_Gen = generator.Generator()
            temp_List = temp_Gen.outPut()
            self.listIns.append(temp_List)

            temp_MinSubSum = alg.MinSubsum(temp_List)
            temp_minMax = temp_MinSubSum.splitArray()
            self.minMax.append(temp_minMax)

    def outPut(self):
        print("开始测试！")
        for i in range(self.listNums):
            print("初始非零数组为:{0} , 其子数组数目为:{1}".format(self.listIns[i][0] , self.listIns[i][1]))
            print("求得的最小的最大子数组和为:{0} , 执行算法所用时间为:{1}".format(self.minMax[i][0] , self.minMax[i][1]))
            print()

if __name__ == "__main__":
    test1 = Test(5)
    print(test1.outPut())